﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data.SqlClient;
using System.Linq;
using System.Text;

namespace Fitness_club
{
   public class helper
    {
       static string connection = ConfigurationManager.AppSettings["ConStr"].ToString();
        SqlConnection con = new SqlConnection(connection);
        
        public int SqlCmd_Exec(SqlCommand cmd)
        {
            int res = 0;
            cmd.Connection = con;
            if (con.State == System.Data.ConnectionState.Closed)
            {
                con.Open();
            }
            res = cmd.ExecuteNonQuery();
            con.Close();
            return res;
        }
    }
}
